﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using GameBase;
using Microsoft.Xna.Framework;

namespace GalaxyPresident
{
    class SunView : MutiSpriteObject
    {
        protected static Texture2D SUN_TEXTURE =
            Constant.content.Load<Texture2D>(@"Resources/sun");
        Sun sun;
        public SunView(SolarSystem solarSystem)
        {

            this.sun = solarSystem.TheSun;
            Sprite spriteSun = new Sprite(SUN_TEXTURE, 1,1);
            spriteSun.SetOriginPosition(ORIGIN_POSITION.Center);
            spriteSun.Color = solarSystem.Color;
            Scale = sun.Diameter / spriteSun.Width;
            AddSprite(spriteSun);

            Sprite spriteSun_g = new Sprite(@"Resources/sun_g", 1, 1);
            spriteSun_g.SetOriginPosition(ORIGIN_POSITION.Center);
            spriteSun_g.Color = Color.Lerp(spriteSun.Color, Color.White, 0.5f); ;
            AddSprite(spriteSun_g);
            position = sun.Position;
            Depth = 0.11f;
        }
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Update(gameTime);
            position = sun.Position;
        }
    }
}
